package y23.Oct;

import javax.swing.plaf.nimbus.State;

public class Test25 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(()-> {
            for (int i = 0; i < 10; i++) {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        Thread.State state = thread.getState();
        System.out.println(state);
        thread.start();
        state = thread.getState();
        System.out.println(state);
        while(state != Thread.State.TERMINATED){
            state = thread.getState();
            Thread.sleep(100);
            System.out.println(state);
        }
        thread.start();
    }
}
